package com.wyg.learn.utils;

/**
 * @description:
 * @author: WYG
 * @time: 2020/10/24 12:30
 */

public class RPCResponse {
    private Integer requestId;
    private Exception exception;
    private Object result;

    public boolean hasException() {
        return exception != null;
    }

    public RPCResponse(Integer requestId, Exception exception, Object result) {
        this.requestId = requestId;
        this.exception = exception;
        this.result = result;
    }

    public RPCResponse() {}

    public Integer getRequestId() {
        return requestId;
    }

    public void setRequestId(Integer requestId) {
        this.requestId = requestId;
    }

    public Exception getException() {
        return exception;
    }

    public void setException(Exception exception) {
        this.exception = exception;
    }

    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }
}
